package com.sanzang.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author sanzang
 * @since 2020-08-15
 */
@RestController
@RequestMapping("/tProject")
public class TProjectController {

	// session 里放数据
	@RequestMapping("/put")
	public String test1(HttpSession session ) {
		String id = session.getId();
		session.setAttribute("info", "biaoge");
		System.out.println("session 里放数据。。。"+id);		
		return id;
	}

	// session 里取数据
	@RequestMapping("/get")
	public String test2(HttpSession session) {
		Object obj =session.getAttribute("info");
		System.out.println( session.getId() + "session 里取数据。。。"+ obj);		
		return "ok";
	}

}
